import request from '@/utils/request'
import type { ApiResponse } from '../index'
import type { Service, ServiceComment } from '@/types/service'

// 服务相关接口
export const serviceApi = {
  // 获取服务列表
  getList() {
    return request.get<ApiResponse<Service[]>>('/public/services/list')
  },

  // 获取服务详情
  getDetail(id: number) {
    return request.get<ApiResponse<Service>>(`/public/services/${id}`)
  },

  // 获取服务评论
  getComments(serviceId: number) {
    return request.get<ApiResponse<ServiceComment[]>>(`/public/services/${serviceId}/comments`)
  },

  // 获取服务评分
  getRating(serviceId: number) {
    return request.get<ApiResponse>(`/public/services/${serviceId}/rating`)
  },

  // 获取我的服务列表
  getMyServices() {
    return request.get<ApiResponse<Service[]>>('/user/services/my')
  }
} 